package com.party.mobile.web.controller.analysis;


import com.party.mobile.biz.analysis.StatisticalEventFlowBizService;
import com.party.mobile.biz.analysis.StatisticsFlowBizService;
import com.party.mobile.web.dto.AjaxResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("test/analysis/flow")
public class TestController {
    @Autowired
    private StatisticalEventFlowBizService statisticalEventFlowBizService;
    @Autowired
    private StatisticsFlowBizService statisticsFlowBizService;
    Logger logger = LoggerFactory.getLogger(getClass());
    @ResponseBody
    @RequestMapping(value = "test1")
    public AjaxResult test1(HttpServletResponse response, HttpServletRequest request) {
        System.out.println("开始执行更新事件关系的任务");
        logger.info("开始执行更新事件关系的任务");
        long staTime = System.currentTimeMillis();
        statisticalEventFlowBizService.eventDataMaintenance();
        logger.info("执行更新事件关系的任务结束，用时："+(System.currentTimeMillis()-staTime));
        System.out.println("执行更新事件关系的任务结束，用时："+(System.currentTimeMillis()-staTime));
        return AjaxResult.success();
    }
    @ResponseBody
    @RequestMapping(value = "test2")
    public AjaxResult test2(HttpServletResponse response, HttpServletRequest request) {
        System.out.println("开始执行更新页面关系的任务");
        logger.info("开始执行更新页面关系的任务");
        long staTime = System.currentTimeMillis();
        statisticsFlowBizService.pageDataMaintenance();
        logger.info("执行更新事件页面的任务结束，用时："+(System.currentTimeMillis()-staTime));
        System.out.println("执行更新事件页面的任务结束，用时："+(System.currentTimeMillis()-staTime));
        return AjaxResult.success();
    }
}
